/*
 * @Author: wjk
 * @Date: 2020-06-30 14:40:19
 * @LastEditors: wjk
 * @LastEditTime: 2020-07-22 20:27:39
 * @description: file content
 */
import request from '@/utils/request'
import { requestNew } from '@/utils/request'
// 商品详情
export async function goodsDetail(params) {
  const res = await request({
    url: '/goods/detail',
    method: 'post',
    data: params || {}
  })
  return res
}
// 箱起详情接口
export async function boxGoodsDetail(params) {
  const res = await request({
    url: '/goods/detail/box',
    method: 'post',
    data: params || {}
  })
  return res
}
// 箱起详情接口
export async function validataSignin(params) {
  const res = await requestNew({
    url: '/signin/validate',
    method: 'post',
    data: params || {}
  })
  return res
}

// 箱起详情接口
export async function shortUrl(params) {
  const res = await requestNew({
    url: '/shorturl/get',
    method: 'post',
    data: params || {}
  })
  return res
}

// 取得运费信息
export async function getCalculate(data = {}) {
  const res = await requestNew({
    url: '/v1/freight/template/calculate',
    method: 'POST',
    isNot: 'false',
    headers: {
      'Content-Type': 'application/json',
      'showLoading': false
    },
    data
  })
  return res
}

// 取得配送信息，无运费
export async function getSendInfo(data = {}) {
  const res = await requestNew({
    url: '/v1/freight/template/info',
    method: 'POST',
    data
  })
  return res
}

// 会员日校验
export async function getVipDayInfo(params) {
  const res = await requestNew({
    url: '/vip-day/app-api/user/check',
    method: 'post',
    data: params || {},
    headers: {
      'Content-Type': 'application/json'
    }
  })
  return res
}

// 会员日校验
export async function getBoxFright(data = {}) {
  const res = await request({
    url: '/order/freight/calculate',
    method: 'POST',
    data
  })
  return res
}

// 礼包运费测算
export async function getBonusFright(data = {}) {
  const res = await request({
    url: '/goods/detail/box/freight',
    method: 'POST',
    data
  })
  return res
}

//查询优惠商品接口
export async function getDiscountGoods(params) {
  return await request({
    url: '/goods/discount/get',
    method: 'get',
    params:params
  })
}